﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Xml.Serialization;

namespace Sovigaz.DataProvider
{
    public partial class SovigazDbContext
    {
        public DbSet<InOut> InOuts { get; set; }
    }

    [Table("InOuts")]
    public class InOut : AuditableEntity
    {
        [Key]
        public int InOutID { get; set; }

        public int UserID { get; set; }        

        public int DeliveryPlanID { get; set; }

        public string InOutCode { get; set; }

        public DateTime Date { get; set; }

        public string Type { get; set; }

        public string Status { get; set; }

        public string Description { get; set; }

        [XmlIgnore]
        [NotMapped]
        public ICollection<InOutLineComplex> InOutLines { get; set; }
    }

    public class InOutComplex
    {
        public int InOutID { get; set; }

        public int UserID { get; set; }         

        public int DeliveryPlanID { get; set; }

        public string InOutCode { get; set; }

        public string DeliveryPlanCode { get; set; }

        public string UserFullName { get; set; }

        public DateTime Date { get; set; }

        public string Type { get; set; }

        public string Status { get; set; }

        public string Description { get; set; }

        public ICollection<InOutLineComplex> InOutLines { get; set; }

        public bool IsDeleted { get; set; }
    }

    public enum InOutType { I, R }

    public enum InOutStatus { N, S, C }
}